package org.example.qweqq.anno;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.example.qweqq.validation.StateValidation;


import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;


@Documented
@Constraint(
        validatedBy = {StateValidation.class} //指定提供校验规则的类
)
@Target({ FIELD})
@Retention(RUNTIME)

public @interface State {
    //校验失败后的提示信息
    String message() default "state参数值只能是已发布或草稿";
    //指定分组
    Class<?>[] groups() default {};
    //负载 获取该注解附加信息
    Class<? extends Payload>[] payload() default {};
}
